'use strict';
exports.main = async (e, context) => {
	let code = Math.random().toFixed(6).split(".")[1];
	try {
		let res = await uniCloud.sendSms({
			smsKey: "fae28f74bb0094f1bcd9a55bab126fbf",
			smsSecret: "bf0908208ac6edb65603d1795d4e6db6",
			phone: e.phone,
			templateId: "10073",
			data: {
				name: 'cgctm6',
				code,
				action: '注册',
				expMinute: '3',
			}
		});
		return res;
	} catch (err) {
		return {
			code: err.errCode
			msg: err.errMsg
		}
	}
};
